home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
restaurante_1072.swf
/
scripts
/
__Packages
/
Kitchen.as
< prev
next >
Wrap
Text File
|
2009-04-16
|
6KB
|
165 lines
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(!_global.Kitchen)
{
_global.Kitchen extends MissionItem;
var _loc2_ = _global.Kitchen = function($mc, $data)
{
super($mc);
this.chef = this.__get__mc()[$data.chefName];
this.menuList = [];
this.foodList = [];
this.__set__status(Kitchen.REST);
}.prototype;
_loc2_.busyHandle = function()
{
this.chef.gotoAndStop(Kitchen.BUSY);
};
_loc2_.restHandle = function()
{
this.chef.gotoAndStop(Kitchen.REST);
};
_loc2_.addMenu = function(t)
{
this.menuList.push(t);
this.cook();
};
_loc2_.tableCustomerAngry = function(t)
{
var _loc2_ = 0;
while(_loc2_ < this.foodList.length)
{
var _loc3_ = Food(this.foodList[_loc2_]);
if(_loc3_.__get__table() == t)
{
_loc3_.__get__mc().removeMovieClip();
false;
this.foodList.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
_loc2_ = 0;
while(_loc2_ < this.menuList.length)
{
if(t == this.menuList[_loc2_])
{
this.menuList.splice(_loc2_,1);
this.cook();
break;
}
_loc2_ = _loc2_ + 1;
}
};
_loc2_.getFood = function(food)
{
var _loc2_ = 0;
while(_loc2_ < this.foodList.length)
{
if(food == this.foodList[_loc2_])
{
this.foodList.splice(_loc2_,1);
this.refresh();
break;
}
_loc2_ = _loc2_ + 1;
}
return food;
};
_loc2_.cook = function()
{
if(this.isBusy())
{
return undefined;
}
this.__set__status(Kitchen.BUSY);
var t = Table(this.menuList.shift());
var obj = this;
var interval = setInterval(function()
{
obj.createFood(t);
clearInterval(interval);
}
,this.cookDelay);
};
_loc2_.isBusy = function()
{
return this._status == Kitchen.BUSY;
};
_loc2_.createFood = function(t)
{
if(t.__get__isNotFull() || t.__get__customerLeave())
{
this.__set__status(Kitchen.REST);
if(this.menuList.length > 0)
{
this.cook();
}
return undefined;
}
var _loc3_ = new Food(this.__get__mc().attachMovie(MissionData.DATA[Mission.getMission().__get__id()].food.linkName,"food" + getTimer(),this.__get__mc().getNextHighestDepth()),t);
this.foodList.unshift(_loc3_);
this.refresh();
var _loc2_ = new Sound();
_loc2_.attachSound("Ling");
_loc2_.start();
this.__set__status(Kitchen.REST);
if(this.menuList.length > 0)
{
this.cook();
}
return _loc3_;
};
_loc2_.refresh = function()
{
var _loc2_ = 0;
while(_loc2_ < this.foodList.length)
{
Food(this.foodList[_loc2_]).__get__mc().swapDepths(_loc2_);
_loc2_ = _loc2_ + 1;
}
};
_global.Kitchen = function($mc, $data)
{
super($mc);
this.chef = this.__get__mc()[$data.chefName];
this.menuList = [];
this.foodList = [];
this.__set__status(Kitchen.REST);
}.BUSY = "busy";
_global.Kitchen = function($mc, $data)
{
super($mc);
this.chef = this.__get__mc()[$data.chefName];
this.menuList = [];
this.foodList = [];
this.__set__status(Kitchen.REST);
}.REST = "rest";
_loc2_.cookDelay = 3000;
§§push(ASSetPropFlags(_global.Kitchen.prototype,null,1));
}
§§pop();
}
}
§§goto(addr441);
}
§§push(function §\x1b�\x02§(§�\x07§, §\x01§, §\x02\x01§, §\x01§, §��\x1b\x02�\x15\x029§, _global, Kitchen, chef, __get__mc, chefName, menuList, foodList, REST, __set__status)
{
} lt §§pop());
}
addr441: